package com.example.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
//@Slf4j
//@Component
//@Aspect
//public class HistoryRecord {
//    //记录客户记录，方便消息提示
//    @Around("@annotation(com.example.aop.history)")
//    public Object histortrecord(ProceedingJoinPoint joinPoint) throws Throwable {
//        //1.操作前
//        long begin =System.currentTimeMillis();
//        //2.操作中
//        Object result =joinPoint.proceed();
//        //3.操作后
//         String className =joinPoint.getTarget().getClass().getName();
//         String methodName =joinPoint.getSignature().getName();
//         Object[] args = joinPoint.getArgs();
//         Object voi= joinPoint.proceed();
//         long end = System.currentTimeMillis();
//         log.info("{}在{}执行了{}类的{}的{}方法，方法的运行参数为{}，返回值为{}，执行时间为{}",);
//         return result;
//    }
//}
